load IntnlData;
SetupDataB;

clear RI_Local;
NumEst(~isfinite(NumEst)) = 0; Anlyst = log(1+NumEst); Anlyst(~isfinite(Anlyst)) = NaN; clear NumEst;
Turn = Volume.*P./MV; Turn = Turn/1000; Turn = log(1+Turn); Turn(~isfinite(Turn)) = NaN; clear Volume P; 
MV = log(MV); MV(~isfinite(MV)) = NaN;
Return11 = NaN(N,T,'single');
for t = 11:T
    Return11(:,t) = prod(1+Return(:,t-10:t),2) - 1;
end
if ~ExcludeMicro
    IsMicro = false(N,T,55);
end

load Intnl_WCMonthly ATGrowth BM COGStoAT GPtoAT;
BM(BM<=0) = NaN;
BM = log(BM); BM(~isfinite(BM)) = NaN;
ATGrowth(~isfinite(ATGrowth)) = NaN;
GPtoAT(~isfinite(GPtoAT)) = NaN;
COGStoAT(~isfinite(COGStoAT)) = NaN;

XVARS = NaN(N,T,7,'single');
XVARS(:,:,1) = -BM; %DT
XVARS(:,:,2) = Turn; clear Turn; %LS
XVARS(:,:,3) = -Anlyst; clear Anlyst; %HLS
XVARS(:,:,4) = -Hi52w; clear Hi52w; %GH
XVARS(:,:,5) = -DGW; clear DGW; %DGW
XVARS(:,:,6) = -COGStoAT; clear COGStoAT; %SS
XVARS(:,:,7) = RetVol; clear RetVol; %Z
XVARS(~isfinite(XVARS)) = NaN;

TFirst = find(ym==199303); THalf = find(ym==200612);
